package com.kun.lagou.service.impl;

import com.kun.lagou.dao.UserRepository;
import com.kun.lagou.entity.User;
import com.kun.lagou.service.UserService;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Administrator
 */
@Component("userService")
@Transactional(rollbackFor = Exception.class)
public class UserServiceImpl implements UserService {
    private UserRepository userRepository;
    public UserServiceImpl(UserRepository userRepository) {
        this.userRepository = userRepository;
    }

    @Override
    public User findByUsername(String username) {
        return this.userRepository.findByUsername(username);
    }
}
